package menus;

import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import user.Rights;

/**
 *
 * @author Thorsten Ludwig
 */

@Entity
public class LectureMenuItem implements Serializable {
    
    /**
     * 
     */
    private String name;
    /**
     * 
     */
    private String link;
    /**
     * 
     */
    @OneToOne(cascade=CascadeType.ALL)
    private Rights rights;
    @Id
    @GeneratedValue
    private Long id;
   
    /**
     * Create a new menu item for a lecture
     * @param name name of the menu item
     * @param link link to the menu item
     */
    public LectureMenuItem(String name, String link) {
        System.out.append("Lecture Menu Item erstellt");
        this.name = name;
        this.link = link;
        this.rights = new Rights();
        System.out.append("Lecture Menu Item erstellt");
    }
    
    public LectureMenuItem() {
        this.rights = new Rights();
    }
    
    /*
    public LectureMenuItem() {
        System.out.append("Leeres Lecture Menu Item erstellt");
        this.rights = new Rights();
    }*/

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Rights getRights() {
        return rights;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}
